package com.wfit.bankproject.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.wfit.bankproject.entity.UserRole;
import com.wfit.bankproject.mapper.UserRoleMapper;
import com.wfit.bankproject.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {
   @Autowired
   private UserRoleMapper mapper;
//    @Override
//    public int deleteByUserId(Long userId) {
//      LambdaQueryWrapper<UserRole> queryWrapper=new LambdaQueryWrapper<>();
//      queryWrapper.eq(UserRole::getUserId,userId);
//
//        int delete = mapper.delete(queryWrapper);
//        return delete;
//
//    }
//
//    @Override
//    public int deleteBYRoleId(Long roleId) {
//        LambdaQueryWrapper<UserRole> queryWrapper=new LambdaQueryWrapper<>();
//        queryWrapper.eq(UserRole::getRoleId,roleId);
//
//        int delete = mapper.delete(queryWrapper);
//        return delete;
//    }
//
//    @Override
//    public List<UserRole> search(Long userId) {
//        LambdaQueryWrapper<UserRole> queryWrapper = new LambdaQueryWrapper<>();
//        queryWrapper.eq(userId!=null,UserRole::getRoleId,userId);
//        queryWrapper.eq(userId!=null,UserRole::getUserId,userId);
//        List<UserRole> userRoles = mapper.selectList(queryWrapper);
//
//        return userRoles;
//    }
}
